﻿using Dapper;
using Gx.Common.Core;
using Gx.Model.Entity;
using Gx.Model.ViewModel;
using System.Collections.Generic;
using System.Linq;
namespace Gx.Dal.Manage
{
    public class LKCostTypesDal:BaseDal<LKCostTypes>
    {
    
        /// <summary>
        /// 名称是否存在
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public bool AnyName(string name)
        {
            using (var conn = new DbContext())
            {
                var total = conn.Connection.QueryFirst<int>("SELECT COUNT(1) FROM LK_CostTypes WHERE IsDeleted=0 AND CostTypeName=@name", new { name });
                return total > 0;
            }
        }
    }
}

